﻿<?php
$params = array();
if (isset($_GET['year']) && isset($_GET['month']))
{
    $params = array(
        'year' => $_GET['year'],
        'month' => $_GET['month'],
    );
}

$params['url']  = 'calendar_display.php';

require_once 'lib_calendar.php';

?>
 
<html>
    <head>
        <title>日历大全</title>
        <meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
        <style type="text/css">
            table.calendar 
			 {
                border: 1px solid #050;
            }
            .calendar th, .calendar td
			 {
                width:30px;
                text-align:center;
            }            
            .calendar th
			 {
                background-color:#050;
                color:#fff;
            }
            .today
			 {
			  color:#fff;
			  background-color:#050;                
            }
        </style>
		
		<script language="javascript" src="jquery-1.12.0.js"></script>

		<script language="javascript" type="text/javascript">

		function onSelectDate(date_id)
		{
			$("tr[name='date_tr']").find("td").removeClass();
			$("#"+date_id).addClass("today");
		}

		$(document).ready(function(){
			$("tr[name='date_tr']").find("td").click(function(){
				onSelectDate(this.id);
			})
		});
		

		</script>

    </head>
	
    <body>
        <div style="align:center">
            <?php
                $cal = new Calendar($params);
                $cal->display();
            ?>    
        </div>
    </body>
</html>